package com.lyy.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Liangyaoyun
 */
@Configuration
public class SpringDocConfig {
    private String name = "JoeZhou";
    private String url = "http://localhost:7000/shop-user";
    private String title = "yunch用户微服务";
    private String description = "暂无描述";
    private String version = "v1.0.0";

    /** 通用信息Bean */
    @Bean
    public OpenAPI commonInfo() {

        // 联系对象
        Contact contact = new Contact()
                .name(name)
                .url(url);

        // 展板信息
        Info info = new Info()
                .title(title)
                .description(description)
                .version(version)
                .contact(contact);

        return new OpenAPI().info(info);
    }
}